
import * as types from '../../const/actionTypes'

const initialState = {
    msgMap: '{}',
    nowChatUserId:'' //当前正在聊天的人
};

function socket(state = initialState, action) {
    switch (action.type) {
        case types.UPDATE_MSGMAP:
            return Object.assign({},state,{
                msgMap:action.msgMap
            });
        case types.CHAT_REQUEST:
            return Object.assign({},state,{
                nowChatUserId: action.nowChatUserId
            })
        default:
            return state
    }
}


export default socket